package com.hjlsoft.aftp.ins;

import java.io.IOException;
import java.util.List;

import com.hjlsoft.aftp.filter.InsFilter;
import com.hjlsoft.aftp.filter.InsFilterChain;
import com.hjlsoft.aftp.network.Request;
import com.hjlsoft.aftp.network.Response;

public class ProxyInsHandle implements InsHandle {

	private InsHandle target;
	
	private List<InsFilter> insFilters;
	
	public ProxyInsHandle(InsHandle target, List<InsFilter> insFilters) {
		super();
		this.target = target;
		this.insFilters = insFilters;
	}

	public void execute(Request request, Response response) throws IOException {
		InsFilterChain insFilterChain = new com.hjlsoft.aftp.filter.DefaultInsFilterChain(insFilters.iterator(), target)	;
		insFilterChain.doChain(request, response);		
	}
	
	public String getIns() {
		return target.getIns();
	}

}
